// var baseurl = "http://local.yuanle.com/"//
var baseurl = "http://app.canzhong.net/"//
function islogin(val){
  // console.log(JSON.stringify(val));
  if(val.status == 202){
    console.log('没登录');

    api.openFrame({
        name: 'login',
        url: './login.html',
        pageParam: {

        }
    });
  }else{
    api.toast({
        msg: val.msg,
        duration: 3000,
        location: 'bottom'
    });
  }
};
// 时间戳转日期
function timestampToTime(time) {
  var date = new Date(time * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
  Y = date.getFullYear()
  M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  D = change(date.getDate())
  H = change(date.getHours())
  F = change(date.getMinutes())
  h = change(date.getHours())
  m = change(date.getMinutes())
  s = change(date.getSeconds())
  return Y + '年' + M + '月' + D + '日'
}
function change(t) {
  if (t < 10) {
      return "0" + t;
  } else {
      return t;
  }
}
//
// 时间戳转日期
function timestampToTime2(time) {
  var date = new Date(time * 1000); //时间戳为10位需*1000，时间戳为13位的话不需乘1000
  Y = date.getFullYear()
  M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1)
  D = change2(date.getDate())
  H = change2(date.getHours())
  F = change2(date.getMinutes())
  h = change2(date.getHours())
  m = change2(date.getMinutes())
  s = change2(date.getSeconds())
  return Y + '年' + M + '月' + D + '日' + " " + H + ':' + F
}
function change2(t) {
  if (t < 10) {
      return "0" + t;
  } else {
      return t;
  }
}
